function dateFormat(dateStr) {
    let date = new Date(Date.parse(dateStr));
    // 年 => 2020
    let Y = date.getFullYear();
    // 月 => 06
    let M = String(date.getMonth() + 1).padStart(2, '0');
    // 日 => 29
    let D = String(date.getDate()).padStart(2, '0');
    // 时 => 17
    let hh = String(date.getHours()).padStart(2, '0');
    // 分 => 17
    let mm = String(date.getMinutes()).padStart(2, '0');
    // 秒 => 17
    let ss = String(date.getSeconds()).padStart(2, '0');
    return `${Y}-${M}-${D} ${hh}:${mm}:${ss}`;
}

export { dateFormat };
